<script setup lang="ts">
import { defineProps } from 'vue'

type PropType = {
  title?: string
  back?: boolean
}
defineProps<PropType>()
import { useRouter } from 'vue-router'

const router = useRouter()
</script>

<template>
  <div class="header-title flex">
    <div class="header-title-info">
      <el-text
        v-if="back"
        class="mr-10 text-amber-800"
        @click="router.back()"
        size="large"
        >返回
      </el-text>
      <el-text class="title" size="large">{{ title }}</el-text>
    </div>
    <div class="header-more">
      <slot></slot>
    </div>
  </div>
</template>

<style scoped lang="scss">
.header-title {
  display: flex;
  align-items: center;
  justify-content: space-between;

  .header-more {
    display: flex;
    align-items: center;
  }

  .title {
    font-weight: bold;
  }
}
</style>
